<template name='sell'>
<movable-area @click.stop="sp.search.focus=false">
	<!-- 左边用户区 -->
	<view class="left-order font12   relative" >
		<!-- 客户信息区、商品历史销售 -->
		<view class="w100  height50-t" >
			
			<!-- 搜索搜索区 -->
			<view v-if="showDiaobo==false" class="top-but search-box Zindex5" style="padding: 0px 5px;width: calc(100% - 10px);">
				<user_select 
				:showRoute="showRoute"  
				:showBilling="showBilling" 
				:showGongYing="showGongYing" 
				@onclickSelectUser="selectUser"
				@sellFocus="()=>{UserEventListener=false}"
				@sellBlur="()=>{UserEventListener=true}"
				></user_select>
			</view>
			<!-- end -->
			
			<!-- 调拨区域 -->
			<view v-if="showDiaobo==true" class="top-but search-box Zindex5" style="padding: 0px 5px;width: calc(100% - 10px);">
					<view class="flex">
						<view class="flex relative floatleft" >
							<view class="riskTitle">输入仓库ID:</view>
							<input class="search-ipu " 
							placeholder="输入欲要调拨出的仓库ID" 
							placeholder-class="placeholder-class"
							@confirm="diaoboLib"
							v-model="kh.diaoBoWord"
							/>
							<view class="delete-ipu" v-if="kh.diaoBoWord!=''" @click="kh.diaoBoWord=''">
								<img src="../../static/img/delete-1.png"  ></img>
							</view>
						</view>
						<button 
						@click="diaoboLib" 
						class="button-erji" 
						>
							确定
						</button>
					</view>
			</view>

			<!-- 客户个人信息区 -->
			<view class="user-but background-fff"  style="height: calc(100% - 50px);position: relative;margin: auto;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
				<view class=" font18 global-background"  
				style="padding: 10px;"
				v-if="kh.userData.data && kh.userData.data.data.name"
				>
					<view class=" flex1 gap10">
						<view class="flex floatleft0"
						v-if="kh.userData.data.data != undefined" 
						@click="openPageAadmin(kh.userData.data.data.id,kh.userData.data.data.name)">
							
							<view class="justify riskTitle c666 font14" >客户:</view>
							<view class="flex">
								<view class="ipu border1 justify alter margin font14" > {{kh.userData.data.data.name }}</view>
							</view>
						</view>
						
						<view class="info-but font14"
						v-if="kh.userData.data && kh.userData.data.data.name"
						>
							<view class="nowBut but-color1  color5"
							@click="fun_order_add"
							:title="$global.title.m5"
							>新增单据</view>
							
							
							<view class="nowBut but-color1  color3 relative" 
							@click="$refs.userDescr.open()"
							:title="$global.title.m27"
							>
								备忘录
								<view class="decsCount" v-if="kh.userData.data.descr_count>0">{{kh.userData.data.descr_count}}</view>
							</view>
							
							
							<view class="nowBut but-color1  color2" 
							@click="openPageVerifyOrdero(kh.userData.data.data.name,kh.userData.data.data.id)"
							:title="$global.title.m6"
							>对账</view>
							
							<view class="nowBut but-color1  color3 relative"
							@click="$refs.goods_buhuo.open(kh.userData.data.data.id)"
							v-if="kh.userData.data.data != undefined && showGongYing==true"
							>
								智能补货
								<view class="decsCount" v-if="kh.userData.data.descr_count>0">{{kh.userData.data.descr_count}}</view>
							</view>
						</view>
										
					</view>
					
					<view class="flex1 gap10 xd-butt">
						<!-- 线路 -->
						<view class="flex floatleft0"  
						v-if="kh.userData.data.data != undefined && showGongYing==false" 
						>
						
							<text class="justify riskTitle c666 font14" >线路:</text>
							<text class="ipu border1 justify font14">{{kh.userData.data.data.route_name }}</text>
						</view>
										
										
						<!-- 价格等级 -->
						<view class="flex floatleft0"  
						v-if="kh.userData.data.data != undefined && showGongYing==false" 
						>
						
							<text class="justify riskTitle c666 font14" >价格等级:</text>
							<text class="ipu border1 justify font14">{{$routeData.GetLevelItem(kh.userData.data.data.level_id).text }}</text>
						</view>
										
						
						<view class="flex floatleft0">
							<text class="justify riskTitle c666 font14" >联系电话:</text>
							<text class="ipu border1 justify font14">{{kh.userData.data.data.phone}}</text>
						</view>
						
						<!--  -->
						<view class="flex floatleft0"  
						v-if="kh.userData.data.data != undefined && showGongYing==false" 
						>
						
							<text class="justify riskTitle c666 font14" >授信额度:</text>
							<text class="ipu border1 justify font14">￥{{kh.userData.data.data.debt }}</text>
						</view>
						
						<view class="flex floatleft0">
							<text class="justify border1 riskTitle c666 font14">余额:</text>
							<!-- money-scale -->
							<text class="ipu  border1  justify money font14" :class="kh.userData.data.debt>kh.userData.data.data.debt? 'money':''">
								￥{{kh.userData.data.debt}}
							</text>
						</view>

						
						<!-- 积分 -->
						<view class="flex floatleft0"  
						v-if="kh.userData.data.data != undefined && showGongYing==false" 
						>
						
							<text class="justify riskTitle c666 font14" >积分:</text>
							<text class="ipu border1 justify font14">{{kh.userData.data.data.score }}</text>
						</view>
						
					</view>
					
				</view>

				
				<!-- 拥有特定权限并且不是验货模式的可展示 -->
				
				<view class="info-but " v-if="kh.userData.data && kh.userData.data.data.name">
					<view class="flex floatleft">
						<view class="justify riskTitle">
							{{showGongYing==true || showDiaobo==true?'付款给对方':'客户回款'}}：
						</view>
						<!-- 金额 -->
						<input 
						v-model="guozhang.value" 
						placeholder-style="font-size:12px;"
						@confirm="fun_user_income"
						class="search-ipu"
						placeholder="输入过账的金额"
						placeholder-class="placeholder-class"
						/>
					</view>
					
					
					<view @click="$common.noMultipleClicks('fun_user_income',fun_user_income)" 
					class="huikuan" 
					:title="$global.title.m7"
					>
						<view>{{showGongYing==true || showDiaobo==true?'确定付款':'确定回款'}}</view>
						<!-- //动态计算结余 -->
						<view 
						v-if="guozhang.value.length>0"
						class="font12 money_color" 
						style="margin-left: 10px;"
						>结余({{ calculateBalance(kh.userData.data.debt,guozhang.value) }})元</view>
					</view>
					
				</view>

			</view>
			<!-- end -->
			
			<!-- 客户历史购买记录表格区 -->
			<goods_record class="sp_record "
				v-if="sp_record.show && kh.userData.data.data"
				:OnPageSearch="pageGoodsSearch.GoodsId"
				:searchUserId="kh.userData.data.data.id"
				@goodsRecordClose="goodsRecordClose"
				:showSearchClose="true"
				:showGongYing="showGongYing"
				:showDiaoBo="showDiaobo"
			></goods_record>
			<!-- end -->
		</view>
		<!-- 下单草稿表 -->
		<view class="w100 background-fff height50-b" >
			<view class="tab-con " >

				<view style="width: 100%;height: 100%;overflow: auto hidden;">
					<view class="topH" >
						<view class="boxsss100" >
							
							<!-- 操作按钮 -->
							<view class="wed" v-if="cgd.resData.order && cgd.resData.order.id">
								<view class=" flex margin-right">
									<view class="justify flex">单号：</view>
										<!-- 调拨 -->
										<image src="/static/diaobo/chu.png" class="ico-b"
										v-if="cgd.resData.order.status==4" 
										title="调拨出库的订单"
										></image>
										<image src="/static/diaobo/ru.png" class="ico-b"
										v-if="cgd.resData.order.status==5" 
										title="调拨入库的订单"
										></image>
										<!-- dne -->
									<view class=" flex relative" >
										<text class="justify" selectable="true">{{cgd.resData.order.uid_name+cgd.resData.order.id}}</text>
										<view class="back_data" >
											<image src="/static/img/order_type.png"
											:title="$global.title.m29" class="ico" 
											v-if="cgd.resData.order.order_status==1"
											></image>
										</view>
									</view>
									<view class="nowButs ">
										<view >合计:</view>
										<view class="money" v-if="cgd.resData.order &&  cgd.resData.order.id ">￥{{cgd.resData.order.money+" "}}</view>
									</view>
								</view>
								<view class="imgBox flex ov gap10" >
									<view v-if="cgd.resData.order.type != 2 "
									:title="$global.title.m8"
									class="caogao-but color1"
									@click="orderLockFun(cgd.resData.order.id)"
									:class="cgd.resData.order.lock==1 ?'status2':''"
									>
										{{cgd.resData.order.lock==0 ? '锁定':'解锁'}}
									</view>
							
									<view @click="$common.noMultipleClicks('orderBack',orderBack,cgd.resData.order.id)"
									class="caogao-but color2"
									v-if="cgd.resData.order.type==2 && cgd.resData.order.status!=1 "
									:title="$global.title.m9"
									>
										退单
									</view>
									
									<view @click="$common.noMultipleClicks('fun_user_gz',fun_user_gz)"
									class="caogao-but color3"
									v-if="cgd.resData.order.type!=2"
									:title="$global.title.m10"
									>
										过账
									</view>
									<view 
									@click="onClickYH"
									class="caogao-but color4"
									v-if="cgd.resData.order.type!=2"
									title="对此单进行金额优惠"
									>
										优惠
									</view>
									
									<view @click="$common.noMultipleClicks('funCreateOrderList',funCreateOrderList,cgd.resData.order.id)" 
									class="caogao-but color5"
									v-if="cgd.resData.order.type!=2"
									:title="$global.title.m11"
									>
										刷新
									</view>
									
									<view @click="OnOrderAudit(cgd.resData.order.id)" 
									class="caogao-but color6" 
									v-if="cgd.resData.order.pay_success==0 " 
									:class="cgd.resData.order.type ==1 ? 'order_audit':''"
									:title="$global.title.m2"
									>
										拣货
									</view>
									<view 
									class="display " 
									v-if="cgd.resData.order.pay_success==1 " 
									@click="$common.toast($global.title.m211)"
									:title="$global.title.m211"
									>
										拣货
									</view>
									
									
									<view @click="showSelectOrderMode($event)"
									class="caogao-but color7"
									:title="$global.title.m12"
									v-if="cgd.resData.order.status!=1"
									>
									预览
									</view>
									
									<view @click="OnOrderPrint(cgd.resData.order.id,false)"
									class="caogao-but color8"
									v-if="cgd.resData.order.type!=2"
									:title="$global.title.m1"
									>
										打印
									</view>
									
									<!-- 整单删除 -->
									<view
									class="caogao-but color9"
									@click="$common.noMultipleClicks('order_all_delete',order_all_delete,cgd.resData.order.id)"
									v-if="cgd.resData.order.type!=2"
									:title="$global.title.m13"
									>
										删除
									</view>
								</view>
							</view>
							
							<!-- 供应商下单列表 -->
							<table v-if="(showGongYing==true || cgd.resData.order.status==5)  && cgd.resData.list.length>0" id="cell-gongyingshang">
								<!-- 表头 -->
								<thead>
									<tr >
										<th style="min-width: 20px;">序</th>
										<th @click="$common.changeColumnColor('cell-gongyingshang',0)">商品</th>
										<th class="centers" 
										@click="$common.changeColumnColor('cell-gongyingshang',1)">数量</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-gongyingshang',2)">进价</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-gongyingshang',3)">裸价</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-gongyingshang',4)">批价</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-gongyingshang',5)">金额</th>
										<th class="">备注</th>
										<th class="centers">操作者</th>
										<th class="centers" v-if="cgd.resData.order.type!=2 &&  cgd.resData.order.lock!=1">操作</th>
										<th class="centers">操作</th>
									</tr>
								</thead>
								<tbody>
									<!-- 内容 -->
									<tr v-for="(item,index) in cgd.resData.list"
									:key="item.id"
									>
										<td
										style="cursor: pointer;"  
										class="centers  relative font12"
										>
											<view 
											class="but-sj-erji" 
											:class="item.ispack==1 ? 'ispack':''"
											:title="item.ispack==1 ? $global.title.m21:$global.title.m2"
											>
											{{index+1}}
											</view>
										</td>
										
										
										<td 
										:title="item.time_info"
										class="col-0"
										>
											<view
											class="white-space  relative "
											@click="$common.noMultipleClicks('onclickCaogaoGoodinfo',onclickCaogaoGoodinfo,index)"
											>
												<view class="nowrap">
													{{item.goods?item.goods.name:item.goods_name}}
												</view>	
												<view class="back_data">
												
													<image src="/static/img/goods_misk.png"
													:title="$global.title.m17"
													class="ico" v-if="item.goodsIsProfit"
													></image>
													<image
													src="/static/img/jinggao.png" 
													title="当前单据含有修改批发价的记录" 
													class="ico" 
													v-if="item.moneyUpdateRecord"
													></image>
												</view>
											</view>
										</td>
										
										<td v-if="cgd.resData.order.lock==0" class="col-1">
											<view class="centers flex" >
												<input class="order-ipu"
												 v-model="item.counts"
												 
												 :disabled="cgd.resData.order.type==2 || cgd.resData.order.lock==1"
												 @confirm="fun_order_update(item,'money',item.counts)"
												 />
												 <view class="margin">{{item.goods.units}}</view>
											</view>
										</td>
										
										<td v-if="cgd.resData.order.lock==1" class="col-1">
											<view class="centers flex">
												{{item.counts}}
												<view class="margin">{{item.goods.units}}</view>
											</view>
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==false"
										class="col-2">
											<view class="centers"
											:title="item.goods.jinhuojia"
											>
												<input class="order-ipu"
												:class="parseFloat(item.money)<=parseFloat(item.goods.jinhuojia) ? 'color-e40318':''"
												 v-model="item.money"
												 :disabled="cgd.resData.order.type==2 || cgd.resData.order.lock==1"
												@confirm="fun_order_update(item,'money',item.money)"
												 />
												
											</view>
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==true" class="col-2">
											<view
											class="centers" 
											:title="item.goods.jinhuojia"
											>
												{{item.money}}
											</view>
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==false" class="col-3">
											<view class="centers">
												<input class="order-ipu"
												 v-model="item.bare_money"
												@confirm="fun_order_update(item,'bare_money',item.bare_money)"
												 />
											</view>
										</td>
										
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==true" class="col-3">
											<view
											class="centers "
											:title="$global.title.m14" 
											>
												{{item.bare_money}}
											</view>
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==false" class="col-4">
											<view class="centers">
												<input class="order-ipu"
												 v-model="item.pifajia"
												@confirm="fun_order_update(item,'pifajia',item.pifajia)"
												 />
											</view>
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==true" class="col-4">
											<view
											class="centers"
											:title="$global.title.m14" 
											>
												{{item.pifajia}}
											</view>
										</td>
										
										<td class="col-5">
											<view class="centers">
												{{item.sum_money}}
											</view>
										</td>
										
										<td>
											<view class=" font12 flex">
												<view class="riskTitle">{{item.goods.account?item.goods.account:'附加备注'}}：</view>
												<input 
												v-model="item.descr" 
												class="order-ipu"  
												maxlength="30" 
												placeholder-class="placeholder-class"
												:disabled="cgd.resData.order.type==2  || cgd.resData.order.lock==1"
												:placeholder="item.goods.tipmsg"
												@confirm="fun_order_update(item,'descr',item.descr)"
												></input>
											</view>
										</td>
										
										<td>
											<view class="centers font12">
												{{item.uid_name}}
											</view>
										</td>
										
										<td >
											<view class="alter  centers cursor font12" 
											v-if="cgd.resData.order.type!=2 &&  cgd.resData.order.lock!=1"
											@click="$common.noMultipleClicks('fun_order_delete',fun_order_delete,index)"
											>
												删除
											</view>
										</td>
										
										<td>
											<view
											class="alter delete centers font12" 
											@click="$req.printLabel(item.goods_id)"
											>
											打印标签
											</view>
										</td>
									
									</tr>
								</tbody>
							</table>


							<!-- 销售下单列表 -->
							<table  v-if="showGongYing==false && cgd.resData.order.status!=5 && cgd.resData.list.length>0" id="cell-on-gongyingshang">
								<!-- 表头 -->
								<thead>
									<tr >
										<th class="centers" style="min-width: 20px;">
											序
										</th>
										<th @click="$common.changeColumnColor('cell-on-gongyingshang',0)">
											商品
										</th>
										<th class="centers" 
										@click="$common.changeColumnColor('cell-on-gongyingshang',1)">
											数量
										</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-on-gongyingshang',2)">
											批价
										</th>
										<th class="centers"
										@click="$common.changeColumnColor('cell-on-gongyingshang',3)">
											金额
										</th>
										<th class="">
											备注
										</th>
										<th class="centers">
											操作者
										</th>
										<th class="centers">
											操作
										</th>
									</tr>
								</thead>
								<tbody>
									<!-- 内容 -->
									<tr v-for="(item,index) in cgd.resData.list"
									:key="item.id"
									class="font14"
									>
										<td
										style="cursor: pointer;"  
										class="centers  relative font12"  
										@click.stop="fun_order_audit(2,item.id)"
										>
											<view 
											class="but-sj-erji" 
											:class="item.ispack==1 ? 'ispack':''"
											:title="item.ispack==1 ? $global.title.m21:$global.title.m2"
											
											>
											{{index+1}}
											</view>
										</td>
										
										<td class="white-space  relative col-0"
										:title="item.time_info"
										@click="$common.noMultipleClicks('onclickCaogaoGoodinfo',onclickCaogaoGoodinfo,index)"
										>
											<view class="nowrap flex" 
											:class="item.GoodsPairedBinding.type==true && item.GoodsPairedBinding.status==false?'low':''"
											>
												<view class="flex ">
													<text 
														v-if="item.plan_max_out.status"
														class="gift"
														@click.stop="openPlanPages(2,item.plan_max_out.data.data.id)"
													>
													满送
													</text>
													<view 
														v-if="item.plan.status"
														class="gift"
														@click.stop="openPlanPages(1,item.plan.data.id)"
													>
													秒杀
													</view>
												</view>
												<view class="flex justify">{{item.goods?item.goods.name:item.goods_name}}</view>
												
											</view>									
											<view class="back_data">
												<image src="/static/img/goods_misk.png"
												:title="$global.title.m17"
												class="ico" v-if="item.goodsIsProfit"
												></image>
												<image
												src="/static/img/jinggao.png" 
												title="当前单据含有修改批发价的记录" 
												class="ico" 
												v-if="item.moneyUpdateRecord"
												></image>
											</view>
											
										</td>

										<td class="centers col-1" v-if="cgd.resData.order.lock==0">
											<view class="flex">
												<input class="order-ipu"
												 v-model="item.counts"
												 :disabled="cgd.resData.order.type==2 || cgd.resData.order.lock==1"
												 @confirm="fun_order_update(item,'money',item.counts)"
												 />
												<view class="margin">{{item.goods.units}}</view>
											 </view>
										</td>

										<td v-if="cgd.resData.order.lock==1" class="centers col-1">
											<view class="flex">
												{{item.counts}}
												<view class="margin">{{item.goods.units}}</view>
											</view>
										</td>

										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==false"
										class="centers col-2"
										:title="item.goods.jinhuojia"
										>
											<input class="order-ipu"
											:class="parseFloat(item.money)<=parseFloat(item.goods.jinhuojia) ? 'color-e40318':''"
											 v-model="item.money"
											 :disabled="cgd.resData.order.type==2 || cgd.resData.order.lock==1"
											@confirm="fun_order_update(item,'money',item.money)"
											 />
										</td>
										
										<td v-if="(cgd.resData.order.type==2 || cgd.resData.order.lock==1)==true"
										class="centers col-2"
										:title="item.goods.jinhuojia"
										
										>
											{{item.money}}
										</td>
										
										<td class="centers col-3">
											{{item.sum_money}}
										</td>
										
										<td class="">
											<view class=" flex">
												<view class="riskTitle">{{item.goods.account?item.goods.account:'附加备注'}}：</view>
												<input
												v-model="item.descr" 
												class="order-ipu"  
												maxlength="30" 
												placeholder-class="placeholder-class"
												:disabled="cgd.resData.order.type==2  || cgd.resData.order.lock==1"
												:placeholder = "item.goods.tipmsg"
												@confirm="fun_order_update(item,'descr',item.descr)"
												></input>
											</view>
										</td>
										
										<td class="centers font12">
											{{item.uid_name}}
										</td>
										
										<td >
											<view 
											v-if="cgd.resData.order.type!=2 &&  cgd.resData.order.lock!=1"
											class="alter  centers cursor font12" 
											@click="$common.noMultipleClicks('fun_order_delete',fun_order_delete,index)"
											>
												删除
											</view>
										</td>
										<td v-if="cgd.resData.order.lock==1" class="alter centers cursor" >
											
										</td>
									</tr>
								</tbody>
							</table>

							<!-- 暂无数据 -->
							<empty v-if="cgd.resData.list.length==0"></empty>
							<!-- end -->

						</view>
					</view>
				</view>
			</view>
			<!-- endend -->
		</view>
	</view>
	<!-- end -->
	<!-- 右边下单区域 -->
	<view class="box-infos font12   relative">
		<view class="wh100 tabW">
			<!-- 菜单栏 -->
			<view class="right-top-box" >
				<view @click="$common.noMultipleClicks('onMenuClick',onMenuClick,1)" 
				:class="mune.index==1 ?'select':''" 
				class="info w333">
				<img :src="'@../../static/img/xd.png'" class="ico"></img>
				<view class="justify">点单台</view>
				</view>
				
				<view @click="$common.noMultipleClicks('onMenuClick',onMenuClick,2)" 
				:class="mune.index==2 ?'select':''" 
				class="info w333">
				<img :src="'@../../static/img/cgd.png'" class="ico"></img>
				<view class="justify">草稿单</view>
				</view>
				
				<view @click="$common.noMultipleClicks('onMenuClick',onMenuClick,3)" 
				:class="mune.index==3 ?'select':''" 
				class="info w333">
				<img :src="'@../../static/img/sl.png'" class="ico"></img>
				<view class="justify">历史单</view>
				</view>
				
				
				
			</view>
			<!-- end -->
			<!-- 点单台 -->
			<view class="box-main" v-show="mune.index==1">
				
				<view class="boxsss40" style="display: block;">
							
					<!-- 快速下单区 -->
					<view class="xd-main flex" v-if="sp.nowGoodsId>=0">
						<view style="overflow: auto;gap: 10px;display: grid;">
							
							<view class="w100 flex xd-box">
								<view class="flex "  v-if="showGongYing==false">
									<text selectable="true"  class="margin" style="padding: 0 5px;">
										每{{prepareSendOrder.item.units_sumName}}<text class="font14 weight alter">{{prepareSendOrder.item.units_count}}</text> {{prepareSendOrder.item.units}}
									</text>
								</view>


								<view class="flex floatleft " >
									
									<view class="riskTitle">下单:</view>
									<input class="search-ipu w70" 
									placeholder="输入下单数量" 
									placeholder-class="placeholder-class"
									:focus="prepareSendOrder.count.focus"
									@blur="()=>{prepareSendOrder.count.focus=false}"
									@confirm="orderConfirmCount(1)"
									v-model="prepareSendOrder.count.value"
									/>
									<text selectable="true"  class="margin" style="padding: 0 5px;">{{prepareSendOrder.item.units}}</text>
								</view>
								
								<!-- v-model="prepareSendOrder.money.value" -->
								<view class="flex floatleft" >
									
									
									<view class="riskTitle">{{showGongYing==true ?'进货':'批发'}}价:</view>
									<input
									class="search-ipu w70" 
									placeholder="输入商品的价格"
									placeholder-class="placeholder-class"
									:focus="prepareSendOrder.money.focus"
									@blur="()=>{prepareSendOrder.money.focus=false}"
									@confirm="prepareSendOrder.money.focus=false,$common.noMultipleClicks('staratMoneyCreateOrder',staratMoneyCreateOrder,1)"
									selection-start="0" 
									:selection-end="prepareSendOrder.money.selectEnd"
									v-model="prepareSendOrder.money.value"
									/>
								</view>
								<view class="flex floatleft" v-if="showGongYing==true" >
									<view class="riskTitle">裸价:</view>
									<input
									class="search-ipu w70" 
									placeholder="输入商品的进货时的裸价"
									placeholder-class="placeholder-class"
									:focus="prepareSendOrder.bare_money.focus"
									
									@blur="()=>{prepareSendOrder.bare_money.focus=false}"
									@confirm="prepareSendOrder.bare_money.focus=false,$common.noMultipleClicks('staratBareMoneyCreateOrder',staratBareMoneyCreateOrder,1,$event)"
									selection-start="0" 
									:selection-end="prepareSendOrder.bare_money.selectEnd"
									v-model="prepareSendOrder.bare_money.value"
									/>
								</view>

								<view class="flex floatleft" v-if="showGongYing==true" >
									
									<view class="riskTitle">批发价:</view>
									<input
									class="search-ipu w70" 
									placeholder="输入商品对外销售的批发价格"
									placeholder-class="placeholder-class"
									:focus="prepareSendOrder.pifajia.focus"
									@blur="()=>{prepareSendOrder.pifajia.focus=false}"
									@confirm="prepareSendOrder.pifajia.focus=false,$common.noMultipleClicks('funCreateOrder',funCreateOrder,1,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
									selection-start="0" 
									:selection-end="prepareSendOrder.pifajia.selectEnd"
									v-model="prepareSendOrder.pifajia.value"
									/>
								</view>

								<view class="flex floatleft" >
									<view class="riskTitle">{{prepareSendOrder.item.account }}：</view>
									<input class="search-ipu" 
									:placeholder="prepareSendOrder.item.tipmsg"
									placeholder-class="placeholder-class"
									@confirm="$common.noMultipleClicks('funCreateOrder',funCreateOrder,1,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
									v-model="prepareSendOrder.descr.value"
									/>
								</view>
								<view class="flex "  v-if="showGongYing==false">
									<text selectable="true"  class="margin" style="padding: 0 5px;">
										零售价:<text class="font14 weight alter">{{prepareSendOrder.item.petail_price}}</text>元
									</text>
								</view>
							</view>
					
							<view class="w100 flex xd-box">
								<button class="but but-color1  color1" 
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,1,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>销售下单(默认)</button>
								
								<button class="but but-color1  color2" 
								:title="$global.title.m18"
								@click="prepareSendOrder.descr.value='已取',$common.noMultipleClicks('funCreateOrder',funCreateOrder,1,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品已取</button>
									
								<button class="but but-color1  color3" 
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,4,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品赠送</button>
								
								<button class="but but-color2 color4" 
								v-if="showGongYing==false && showDiaobo==false"
								:title="$global.title.m19"
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,3,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品退回(好)</button>
								
								<button class="but but-color2 color5" 
								v-if="showGongYing==false"
								:title="$global.title.m20"
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,2,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品退回(坏)</button>
								
								<button class="but but-color2 color6" 
								:title="$global.title.m37"
								v-if="showGongYing==true"
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,6,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品退回厂(好)</button>
								
								<button class="but but-color2 color7"
								:title="$global.title.m38"
								v-if="showGongYing==true"
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,13,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品退回厂(坏)</button>
								
								<button class="but but-color2 color8"
								@click="prepareSendOrder.money.value=0,$common.noMultipleClicks('funCreateOrder',funCreateOrder,14,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>商品补送</button>
								
								<button class="but but-color2 color9" 
								v-if="showGongYing==false"
								@click="$common.noMultipleClicks('funCreateOrder',funCreateOrder,12,sp.resData.list[sp.nowGoodsId].id,prepareSendOrder.descr.value)"
								>积分兑换</button>
								
							</view>
						</view>
					</view>
					<!-- 快速下单区 end -->
					
					<!-- 商品列表区 -->
					
					
						<table id="cell-goods" v-show="sp.resData.list &&  sp.resData.list.length>0">
							<!-- 表头 -->
							<thead>
								<tr >
									<th class="centers " style="min-width: 20px;">
										序
									</th>
									
									
									<th class="" style="width: 50%" 
									@click="$common.changeColumnColor('cell-goods',0)">
										商品名称
									</th>
									
									<th class="centers "
									@click="$common.changeColumnColor('cell-goods',1)">
										<view class="flex centers">
											库存
											<view class="sort-button ">
												<view class="desc"  @click="sp.sortValue='risk_desc',fun_goods_all(true);"></view>
												<view class="asc"   @click="sp.sortValue='risk_asc',fun_goods_all(true);"></view>
											</view>
										</view>
									</th>
									
									<th class="centers " v-if="showGongYing==true || showDiaobo==true"
									@click="$common.changeColumnColor('cell-goods',2)">
										裸价
									</th>
									<!-- 进货或销售都是用到 -->
									<th class="centers "
									@click="$common.changeColumnColor('cell-goods',3)">
										<view class="flex centers">
											{{showGongYing==true  || showDiaobo==true ? '进价':'单价'}}
											<view class="sort-button ">
												<view class="desc"  @click="sp.sortValue='money_desc',fun_goods_all(true,false);"></view>
												<view class="asc"   @click="sp.sortValue='money_asc',fun_goods_all(true,false);"></view>
											</view>
										</view>
									</th>
									
									<th class="centers " v-if="showGongYing==true  || showDiaobo==true"
									@click="$common.changeColumnColor('cell-goods',4)">
										批价
									</th>
									
									<th class="centers  " v-if="showGongYing==false" :title="$global.title.m40"
									@click="$common.changeColumnColor('cell-goods',5)">
										<view class="flex centers">
											销量
											<view class="sort-button ">
												<view class="desc"  @click="sp.sortValue='sales_desc',fun_goods_all(true,false);"></view>
												<view class="asc"   @click="sp.sortValue='sales_asc',fun_goods_all(true,false);"></view>
											</view>
										</view>
									</th>
									
								</tr>
							</thead>
							
							<tbody>
								<!-- 内容 -->
								<tr v-for="(item,index) in sp.resData.list"
								:key="item.id"
								@click.stop="fun_select_goods(item,index)"
								:class="sp.nowGoodsId == index ? 'goods-list-select':''"
								>
										<td class="centers  font12 alter" @click.stop="pageSend.goods_id=item.id,pageSend.name=item.name,$refs.pageGoods.open()">
											{{index+1}}
										</td>
										
										<td 
										:title="item.purchase_record.date+' 购买过\n货位：'+item.position" 
										v-if="item.purchase_record.type==true"
										class="maxW relative col-0"
										@click="$common.setClipboardData(item.name)"
										>
											<view class="  " :style="{color:item.purchase_record.type==true ? item.purchase_record.color : ''}">
												<view class="flex ">
													<text 
														v-if="item.plan_max_out.status"
														class="gift"
														@click.stop="openPlanPages(2,item.plan_max_out.data.data.id)"
													>
													满送
													</text>
													<view 
														v-if="item.plan.status"
														class="gift"
														@click.stop="openPlanPages(1,item.plan.data.id)"
													>
													秒杀
													</view>
													<countdown
													fontSize="12px"
													:startTime="item.plan.data.now_date" 
													:endTime="item.plan.data.end_time" 
													v-if="item.plan.status==true" 
													/>
													<countdown
													fontSize="12px"
													:startTime="item.plan_max_out.data.data.now_date" 
													:endTime="item.plan_max_out.data.data.end_time" 
													v-if="item.plan_max_out.status==true" 
													/>
												</view>
												
												<view class="flex">
													
													<text  selectable="true"  class="white-space nowrap "
													v-html="$common.highlightKeywords(item.name,sp.resData.searchArr)"
													
													></text >
													<text @click.stop="OpenModulesImage(index)" class="alter margin-left ">
														{{item.img.length>0?'图':''}}
													</text>
												</view>
											</view>
											<view class="back_data">
												<image src="/static/goods/score.png"
												class="ico" v-if="item.isScore==1"
												:title="$global.title.m30"
												></image>
												
												<image src="/static/img/disabled.png"
												class="ico" v-if="item.disabled.status==true"
												:title="$global.title.m36"
												></image>
											</view>
										</td>
										
										<td :title="'货位：'+item.position"
										v-if="item.purchase_record.type==false" 
										class="maxW relative col-0" 
										@click="$common.setClipboardData(item.name)"
										>
											<view class="  ">
												<view class="flex ">
													<text 
														v-if="item.plan_max_out.status"
														class="gift"
														@click.stop="openPlanPages(2,item.plan_max_out.data.data.id)"
													>
													满送
													</text>
													<view 
														v-if="item.plan.status"
														class="gift"
														@click.stop="openPlanPages(1,item.plan.data.id)"
													>
													秒杀
													</view>
													<countdown
													fontSize="12px"
													:startTime="item.plan.data.now_date" 
													:endTime="item.plan.data.end_time" 
													v-if="item.plan.status==true" 
													/>
													<countdown
													fontSize="12px"
													:startTime="item.plan_max_out.data.data.now_date" 
													:endTime="item.plan_max_out.data.data.end_time" 
													v-if="item.plan_max_out.status==true" 
													/>
												</view>
												
												<!-- {{item.name}} -->
												<view class="flex">
													
													
													<text  selectable="true"  class="white-space nowrap "
													v-html="$common.highlightKeywords(item.name,sp.resData.searchArr)"
													></text >
													<text @click.stop="OpenModulesImage(index)" class="alter  margin-left">
														{{item.img.length>0?'图':''}}
													</text>
												</view>
											</view>
											<view class="back_data">
												<image src="/static/goods/score.png"
												class="ico" v-if="item.isScore==1"
												:title="$global.title.m30"
												></image>
												
												<image src="/static/img/disabled.png"
												class="ico" v-if="item.disabled.status==true"
												:title="$global.title.m36"
												></image>
												
											</view>
										</td>
										
										
										
										<td :title="item.check_date+''+$global.title.m15"
										class="centers  col-1" 
										:class="item.margin>0?'bab100':''"
										v-if="item.check">
											{{item.margin+' '+item.units}}
										</td>
										
										<td :style="item.margin<=0 ?'color:#ff0000':''" 
										class="centers col-1" 
										v-if="item.check==false"
										>
											{{item.margin+' '+item.units}}
										</td>
																		
										
										
										<td class="centers  col-2" 
										:style="item.bare_money <=0 ?'color:#ff0000':''" 
										:title="`进货价:${item.jinhuojia}`"
										v-if="showGongYing==true || showDiaobo==true">
											<text  selectable="true"  >{{item.bare_money}}</text>
										</td>
										
										
								
										<td class="col-3 weight" v-if="item.plan.status==false"
										:title="`进货价:${item.jinhuojia}`"
										>
											<view class="flex centers">
												
												<text selectable="true"  class="white-space">
													¥{{showGongYing==true || showDiaobo==true ? item.jinhuojia : item.pifajia}}
												</text>
											</view>
										</td>
								
										<td class="col-3 weight" v-if="item.plan.status==true"
										:title="`进货价:${item.jinhuojia}`"
										>
											<view class="flex centers ">
												<view class="m-price" >
													¥{{showGongYing==true || showDiaobo==true ? item.jinhuojia : item.pifajia}}
												</view>
												<view class="coupon-tip">¥{{item.plan.data.money}}</view>
											</view>
										</td>
								
										<td class="centers col-4" 
										:style="item.pifajia <=0 ?'color:#ff0000':''" 
										:title="`进货价:${item.jinhuojia}`"
										v-if="showGongYing==true || showDiaobo==true"
										@click.stop
										>
											<input
											:auto-height="true"
											v-model="item.pifajia" 
											@confirm="$routeData.updatePifajia(item.id,item.pifajia)"
											class="centers white-space goodsNameColor order-ipu"
											:style="{color:item.pifajia<=0 ? '#ff0000':'#2ab100'}"
											/>
										</td>
										<td class="centers  font12 col-5" 
										:title="item.sales_count" 
										v-if="showGongYing==false"
										>
											<text  selectable="true"  >{{$common.formatNumber(item.sales_count)}}</text>
										</td>
										
								</tr>
													
							</tbody>
							
						</table>

				</view>
				<!-- end -->
				<pages 
				:current="sp.page.nowPage"
				:sum="sp.page.sum"
				@updatePage="updatePage"
				></pages>
			</view>
			<!-- end -->
			<!-- 草稿单 -->
			<view class="box-main" v-show="mune.index==2">
		
				<view class="boxsss100" >
					<!-- 搜索区 -->
					<view class="top-but search-box" >
						<view class="caogao-but-box font12">
							<view class="ipu-box floatleft" v-if="showGongYing==false">
								<view class="input_confirms">
									<uni-data-select
									:localdata="$routeData.getRoute()"
									v-model="mune.caogao.route.now_id"
									@change="xianluxuanze"
									placeholder="选择线路"
									placeholder-class="placeholder-class"
									></uni-data-select>
									
								</view>
							</view>
							<view class="flex relative floatleft">
								<view class="riskTitle">商品:</view>
								<input class="search-ipu" 
								placeholder="输入欲要搜索商品的名称" 
								placeholder-class="placeholder-class"
								@confirm="fun_GetMenuCaogao()"
								v-model="search.goods_value"
								/>
								<view class="delete-ipu" v-if="search.goods_value!=''" @click="search.goods_value='',fun_GetMenuCaogao()">
									<img src="../../static/img/delete-1.png"  ></img>
								</view>
							</view>
							<button @click="$common.noMultipleClicks('fun_GetMenuCaogao',fun_GetMenuCaogao)" 
							class="button-erji" 
							>
								<img src="../../static/img/update.png" class="ico"></img>
								刷新
							</button>
							
							<button v-if="showGongYing==false" 
							@click="$common.noMultipleClicks('fun_order_audit',fun_order_audit)" 
							class="nowBut  color2"
							:title="$global.title.m4"
							:disabled="canPublish"
							>
								单据拣货
							</button>
							
							<button v-if="showGongYing==false" 
							@click="$common.noMultipleClicks('fun_order_print',fun_order_print,1,'',true)" 
							class="color3 nowBut  " 
							:title="$global.title.m3"
							:disabled="canPublish"
							>
								单据打印
							</button>
							
							<button
							@click="openOrderList(0)" 
							class="color4 nowBut  " 
							:disabled="canPublish"
							>汇总表打印</button>
							
							
							<button
							@click="openOrderList(1)" 
							class="color5 nowBut  " 
							:disabled="canPublish"
							>退货表打印</button>
							
							
							
							<view class="caogao-money margin-left"  v-if="mune.caogao.resData.sum && mune.caogao.resData.sum>0">
								<view class="justify font12">合计</view>
								<view class="ipu flex border1">
									<view class="justify money " style="font-size: 12px;">￥{{mune.caogao.resData.data.sum}}</view>
								</view>
							</view>
						</view>
					</view>
					<!-- end -->
					<table id="cell-cgd" v-if="mune.caogao.resData.list &&  mune.caogao.resData.list.length>0">
						<!-- 表头 -->
						<thead>
							<tr >
								<th class="centers " style="min-width: 20px;">
									<view class="flex centers">
										<view>全选</view>
										<checkbox
											border-color="#333333" activeborderColor="#333333" activeBackgroundColor="#333"
											:checked="caogaoCheckbox.select" 
											@click="caogaoCheckboxChoose_all"
											style="transform:scale(0.7);"
										/>
									</view>
								</th>
								<th class="centers  order_auditfff but-sj-erji" style="min-width: 20px;"
								@click="$common.changeColumnColor('cell-cgd',0)">
									打印
								</th>
								<th class="centers  order_auditfff but-sj-erji" style="min-width: 20px;"
								@click="$common.changeColumnColor('cell-cgd',1)">
									拣货
								</th>
								
								<th class="centers  order_auditfff but-sj-erji" style="max-width: 40px;"
								@click="$common.changeColumnColor('cell-cgd',11)">
									分货
								</th>
								
								<th class="centers  order_auditfff but-sj-erji" style="min-width: 20px;"
								@click="$common.changeColumnColor('cell-cgd',2)">
									验货
								</th>
								<th @click="$common.changeColumnColor('cell-cgd',3)">
									客户
								</th>
								<th class="centers" @click="$common.changeColumnColor('cell-cgd',4)">
									金额
								</th>
								<th class="centers" @click="$common.changeColumnColor('cell-cgd',5)">
									时间
								</th>
								<th class="centers" @click="$common.changeColumnColor('cell-cgd',6)">
									操作者
								</th>
								<th class="centers">
									备注
								</th>
							</tr>
						</thead>
						<tbody>
							<!-- 内容 -->
							<checkbox-group @change="caogaoCheckbox_change" style="display: contents;">
							<tr v-for="(item,index) in mune.caogao.resData.list" 
							:key="index"
							@click="fun_orderOnClick(item.id,item.user_id)"
							:class="caogaoCheckbox.checkbox_status.includes(item.id) ? 'goods-list-select':''"
							>
								<td class="  font12">
									<view class="flex centers">
										<view>{{index+1}}</view>
										<checkbox  class="centers  font12 "
											:value="item.id.toString()" 
											@click.stop
											border-color="#333333" activeborderColor="#333333" 
											activeBackgroundColor="#333"
											:checked="caogaoCheckbox.checkbox_status.includes(item.id)" 
											style="transform: scale(0.7);margin: auto;display: flex;"
										/>
									</view>
								</td>
								
								<td class="centers  col-0">
									<view @click.stop="$common.noMultipleClicks('fun_order_print',fun_order_print,2,item.id,true)" 
									class=" but-sj-erji font12" 
									:class="item.print_count >0 ? 'order_audit':'order_auditfff alter'"
									:title="$global.title.m1"
									>
										{{item.print_count}}
									</view>
								</td>
								
								<!-- 发送拣货 -->
								<td 
								style="cursor: pointer;"  
								class="centers  relative font12 col-1"  
								
								>
									<view class="but-sj-erji" 
									v-if="item.pay_success==0 && item.ispack==0" 
									:class="item.type!=0?'order_audit':'order_auditfff alter'"
									:title="$global.title.m2"
									@click.stop="fun_order_audit(2,item.id)"
									>拣货</view>
									<view 
									class="but-sj-erji ispack" 
									v-if="item.ispack==1" 
									:title="$global.title.m21"
									@click.stop="$common.toast($global.title.m21)"
									>完成</view>
									
									<view 
									class="display" 
									v-if="item.pay_success==1" 
									@click.stop="$common.toast($global.title.m211)"
									:title="$global.title.m211"
									>拣货</view>
									
								</td>
								
								<!-- 发送分货 -->
								<td 
								class="centers  relative  col-11"  
								@click.stop
								title="请输入当前单据需要分货的的货位号"
								>
									<input 
									placeholder="输入" 
									class=" font12" 
									v-model="item.pick_number"
									:class="item.isAllocation==1?'fenhuo2':item.pick_number.length>0?'fenhuo1':'fenhuo'"
									
									@blur="$routeData.goods_pick_number(item.id,item.pick_number)"
									/>
								</td>
								<!-- 验货状态 -->
								<td 
								style="cursor: pointer;"  
								class="centers  relative font12 col-2"  
								@click.stop="fun_order_audit(2,item.id)"
								:title="$global.title.m2"
								>
									<!-- 验货 -->
									<view class="back_data" 
									v-if="item.check.checkSuccess == false"
									:title="$global.title.m24"
									></view>
								
									<view 
									class="back_data" 
									v-if="item.check.checkSuccess==true" 
									:title="$global.title.m23"
									>
										<image class="isCheck" src="/static/img/check.png" ></image>
									</view>
								</td>
								
								<td class="   relative col-3">
									<view class="flex">
										<view class="back_data">
											<image src="/static/img/goods_back.png"
											class="ico" v-if="item.back==0"
											:title="$global.title.m16"
											></image>
											
											<image src="/static/img/goods_misk.png"
											class="ico" v-if="item.goodsIsProfit"
											:title="$global.title.m17"
											></image>
											
											<image src="/static/img/order_type.png"
											:title="$global.title.m29" class="ico" 
											v-if="item.order_status==1"
											></image>
											<image
											src="/static/img/jinggao.png" 
											title="当前单据含有修改批发价的记录" 
											class="ico" 
											v-if="item.moneyUpdateRecord"
											></image>
											
										</view>
										<text class="justify">{{item.name}}</text>
										<image src="/static/diaobo/chu.png" class="ico-b"
										v-if="item.status==4" 
										title="调拨出库的订单"
										></image>
										<image src="/static/diaobo/ru.png" class="ico-b"
										v-if="item.status==5" 
										title="调拨入库的订单"
										></image>
									</view>
								</td>
								
								<td  class="centers  col-4">
									￥{{item.money}}
								</td>
								
								<td class="centers  font12 col-5">
									{{item.date}}
								</td>
								<td class="centers col-6">
									{{item.uid_name}}
								</td>
								
								
								<td>
									
									<descr
									:value="item.descr"
									:order_id="item.id"
									>
									</descr>
								</td>
							</tr>
							</checkbox-group>
						</tbody>
					</table>
					
					<!-- 暂无数据 -->
					<empty v-if="mune.caogao.resData.list &&  mune.caogao.resData.list.length==0"
					></empty>
					<!-- end -->
				</view>
				
			</view>
			<!-- end -->
			<!-- 历史单 -->
			<view class="box-main" v-show="mune.index==3">
			
				<view class="boxsss100" >
					<!-- 操作区 -->
					<view class="top-but search-box">
						<view class="caogao-but-box">
								<view class="date-center floatleft">
									<picker class="date-left" 
									mode="date" 
									:value="mune.lishi.date[0]" 
									@change="changeStartDate"
									>
										<view class="uni-input cursor">{{mune.lishi.date.length >0 ? mune.lishi.date[0]:'开始时间'}}</view>
									</picker>
					
									<view class="date-c"> - </view>
					
									<picker class="date-left" 
									mode="date" 
									:value="mune.lishi.date[1]" 
									@change="changeEndDate"
									>
										<view class="uni-input cursor">{{mune.lishi.date.length >1 ? mune.lishi.date[1]:'结束时间'}}</view>
									</picker>
					
									<view class="delete-ipu" 
									style="position: unset;transform: none;"
									v-if="mune.lishi.date.length >1" 
									@click="mune.lishi.date=[],fun_Getlishi_list(true)"
									>
										<img src="../../static/img/delete-1.png"  ></img>
									</view>
					
								</view>
							
					
							<view class="flex relative floatleft" >
								<view class="riskTitle">商品:</view>
								<input class="search-ipu" 
								placeholder="输入欲要搜索商品的品名" 
								placeholder-class="placeholder-class"
								@confirm="fun_GetMenuCaogao()"
								v-model="search.goods_value"
								/>
								<view class="delete-ipu" v-if="search.goods_value!=''" @click="search.goods_value='',fun_Getlishi_list()">
									<img src="../../static/img/delete-1.png"  ></img>
								</view>
							</view>
							
							<view class="flex relative floatleft">
								<view class="riskTitle">单号:</view>
								<input class="search-ipu" 
								placeholder="输入欲要搜索的订单号" 
								placeholder-class="placeholder-class"
								@confirm="fun_GetMenuCaogao()"
								v-model="search.order_id"
								/>
								<view class="delete-ipu" v-if="search.order_id!=''" @click="search.order_id='',fun_Getlishi_list()">
									<img src="../../static/img/delete-1.png"  ></img>
								</view>
							</view>
							
							<button @click="$common.noMultipleClicks('fun_Getlishi_list',fun_Getlishi_list,true)" 
							class="button-erji" 
							>
								<img src="../../static/img/update.png" class="ico"></img>
								刷新
							</button>
						</view>
					</view>
					<!-- end -->
					<table  v-if="mune.lishi.resData.list &&  mune.lishi.resData.list.length>0">
						<!-- 表头 -->
						<thead>
							<tr >
								<th class="centers " style="min-width: 20px;">
									序
								</th>
								<th class="centers " style="min-width: 20px;">
									打印
								</th>
								<th class="centers " style="min-width: 20px;">
									拣货
								</th>
							
								<th class="centers ">
									金额
								</th>
								<th class="centers ">
									结余
								</th>
								<th class="centers ">
									时间
								</th>
								<th class="centers ">
									操作者
								</th>
								<th class="centers ">
									类型
								</th>
								<th class="centers ">
									备注
								</th>
								<th class="centers ">
									操作
								</th>
							</tr>
						</thead>
						<tbody>
							<!-- 内容 -->
							<tr v-for="(item,index) in mune.lishi.resData.list" 
							:key="index"
							@click="mune.lishi.checked=index,fun_orderOnClick(item.id,item.user_id)"
							:class="mune.lishi.checked == index ? 'goods-list-select':''"
							:style="(item.status==1||item.status==6) ?'color: #e40318;':''"
							>
								<td  class="centers  font12">
									{{index+1}}
								</td>
								
								<td  class="centers  font12">
									<view 
									@click.stop="$common.noMultipleClicks('fun_GetMenuCaogao',fun_GetMenuCaogao)" 
									class=" but-sj-erji font12" 
									:class="item.print_count >0 ? 'order_audit':''"
									>
										{{item.print_count}}
									</view>
								</td>
								
								<td  class="centers  font12">
									<view class="but-sj-erji" 
									v-if="item.ispack==0" 
									:class="item.type!=0?'order_audit':'order_auditfff'"
									>
									拣货
									</view>
									<view class="but-sj-erji ispack" v-if="item.ispack==1 && item.status!=1" >完成</view>
								</td>
								
						
								
								<td  class="centers weight">
									￥{{item.money}}
								</td>
								
								<td  class="centers weight">
									￥{{item.money_m}}
								</td>
								
								<td  class="centers  font12 relative">
									<view class="back_data">
										<image src="/static/img/goods_back.png" 
										class="ico" 
										:title="$global.title.m16"
										v-if="item.back==0"
										></image>
										
										<image src="/static/img/order_type.png"
										:title="$global.title.m29" class="ico" 
										v-if="item.order_status==1"
										></image>
										
										<image src="/static/img/cz_record.png"
										:title="$global.title.m39"
										class="ico"
										v-if="item.money_record==0" 
										@click.stop="$refs.chongzhang_order.open(item.id)"
										></image>
										
										<image 
										src="/static/img/goods_misk.png" 
										:title="$global.title.m17" 
										class="ico" 
										v-if="item.goodsIsProfit"
										></image>
										
										<image
										src="/static/img/jinggao.png" 
										title="当前单据含有修改批发价的记录" 
										class="ico" 
										v-if="item.moneyUpdateRecord"
										></image>
									</view>
									{{item.date}}
								</td>
								
								<td  class="centers ">
									{{item.uid_name}}
								</td>
								<td  class="centers " >
									{{item.order_type}}
								</td>
								<td>
									<descr
									:value="item.descr"
									:order_id="item.id"
									>
									</descr>
								</td>
								<td  class="centers " >
									<view class="flex gap10">
										<button class="font12 color1"
										v-if="(item.status==1||item.status==6) && index==0" 
										@click.stop="$refs.chongzhang.open(item)">修正</button>
										
										<button class="font12 color2 "
										v-if="(item.status==1||item.status==6) && index==0" 
										@click.stop="$req.deleteOeder(item.id)"
										>删除</button>
									</view>	
								</td>
							</tr>
						</tbody>
					</table>
					<!-- 暂无数据 -->
					<empty v-if="mune.lishi.resData.list &&  mune.lishi.resData.list.length==0"></empty>
					<!-- end -->
				</view>
				
				<!-- 分页 -->
				<pages 
				:current="mune.lishi.page.nowPage"
				:sum="mune.lishi.page.sum"
				@updatePage="updatePage_lishi"
				></pages>
				<!-- end -->
		
			</view>
			<!-- end -->
		
		</view>
		<view class="goodsSearchBox" @click.stop="sp.search.focus=true">
			<view class="jiyi" v-show="sp.search.focus">
				<text class="dSLComVueLogBox mytext"
				v-for="(item,index) in search_list_old" 
				:key="index" 
				@click.stop="sp.search.word=item,$common.noMultipleClicks('fun_goods_all',fun_goods_all,true)">
					{{item?item:'无'}}
				</text>
			</view>
			<view class="caogao-but-box">
				<view style="display: flex;" class="w100">
					<view class="searchBoxs floatleft">
						<view class="riskTitle">
							搜索商品：
						</view>
						<input
						@blur="_search_list_oldShow()"
						v-model="sp.search.word" 
						@confirm="sp.sortValue='',$common.noMultipleClicks('fun_goods_all',fun_goods_all,true)"
						@input="$common.noMultipleClicks('onSearchInput',onSearchInput)"
						class="search-ipu w200"
						placeholder="输入商品名称 货位 ID 别称 首拼进行搜索"
						placeholder-class="placeholder-class"
						selection-start="0"
						:selection-end="sp.search.selectEnd"
						@focus="sp.search.selectEnd=sp.search.word.length,_init_search()"
						/>
						<view class="delete-ipu" v-if="sp.search.word!=''" @click="sp.search.word=''">
							<img src="../../static/img/delete-1.png"  ></img>
						</view>
					</view>
					<view @click="sp.sortValue='',$common.noMultipleClicks('fun_goods_all',fun_goods_all,true)" 
					class="button-erji " >
						<img src="../../static/img/update.png" class="ico"></img>
						搜索
					</view>
					
					
					<button @click="GoodsSearchSelectUser" 
					v-if="showGongYing"
					class="button-erji back_color"
					:disabled="kh.userData.data.data ==undefined || kh.userData.data.data.id ==undefined">
						<img src="../../static/img/update.png" class="ico"></img>
						当前供应商
					</button>
					
				
					
					<view class="justify">
						<checkbox-group  class="margin flex" style="margin: auto 10px;" @change="isCheckKCFnu">
							<checkbox 
							value="1"
							border-color="#333333" activeborderColor="#333333"  
							activeBackgroundColor="#333"
							style="transform:scale(0.7);" />
							<view class="margin">只显示有库存</view>
						</checkbox-group>
					</view>
				</view>
			</view>
		</view>
	</view>
	<!-- end -->
	
	<printList ref="orderPrints"></printList>
	<chongzhang ref="chongzhang" ></chongzhang>
	<!-- <selectGoods ref="selectGoods" @change="openGoodsSelectChange"></selectGoods> -->
	
	<!-- 用户详情页 -->
	<uni-popup ref="page_admin" type="center" :title="pageSearch.name" >
		<person_admin :OnPageSearchUserId="pageSearch.user_id" :sendType="pageSearch.type" status="firm_user_list" class="page-boxs h100"></person_admin>
	</uni-popup>
	<!-- end -->
	
	<!-- 商品页面 -->
	<uni-popup ref="pageGoods" type="center" :title="pageSend.name">
		<shopping_admin :isPop="false" :OnPageSearchGoodsId="pageSend.goods_id" minHeight="600px" class="  h100"></shopping_admin>
	</uni-popup>
	<!-- end -->
	
	<!-- 用户单据流水页面 -->
	<uni-popup ref="verifyOrdero" type="center" :title="kh.userData.data.data.name+' 单据流水'">
		<verify_ordero :OnPageUserId="verifyOrdero.user_id"  class="h100"></verify_ordero>  
	</uni-popup>
	<!--用户单据流水页面 end -->

	<!-- 活动界面 -->
	<uni-popup ref="pagePlan" type="center" title="活动详情">
		<sales_plan :OnPageSearchId="openPlan.id" v-if="openPlan.type==1"  class="h100"></sales_plan>
		<max_out_plan :OnPageSearchId="openPlan.id" v-if="openPlan.type==2"  class="h100"></max_out_plan>
	</uni-popup>
	<!--活动界面 end -->
	


	<!-- 用户备注 -->
	<uni-popup ref="userDescr" type="center" :title="kh.userData.data.data.name+' 备忘录'" minHeight="auto" minWidth="auto">
		<user_descr :user_id="kh.userData.data.data.id"  class="h100"></user_descr>  
	</uni-popup>
	<!--用户备注 end -->
	
	
	<!--详细单据 end -->
	<goodsImage :goodsList="sp.resData.list" @goodsPreviewImageIndex="goodsPreviewImageIndex" ref="modulesImage"></goodsImage>
	
	
	

	<!-- 搜索区 -->
	<cz_record ref="chongzhang_order"></cz_record>

	<!-- end -->
	<buhuo ref="goods_buhuo" @on_goods="on_goods"></buhuo>
	
	
	<!-- end -->
	<prinr_select ref="prinrSelectBox"></prinr_select>
</movable-area>
	
</template>

<script>
	import prinr_select from "@/components/print_jcp/select.vue"

	import cz_record from "@/components/chongzhang/record"
	import chongzhang from "@/components/chongzhang/chongzhang.vue"
	import goodsImage from "@/components/goods/image.vue"
	import countdown from "@/components/cz-countdown/cz-countdown"
	import pages from "@/components/admin-components/pages.vue"
	import empty from "@/components/admin-components/empty.vue"
	import person_admin from "@/components/user/list.vue"
	import shopping_admin from "@/components/goods/goods.vue"
	import verify_ordero from "@/components/verifyOrdero/verify_ordero.vue"
	import goods_record from "@/components/goods_record/goods_record.vue"
	import user_select from "@/components/user/select.vue"
	import userGoodsRecord from "@/components/userGoodsRecord/userGoodsRecord.vue"
	import sales_plan from "@/components/sales_plan/sales_plan.vue"
	import max_out_plan from "@/components/sales_plan/max_out_plan.vue"
	import print_jcp from "@/components/print_jcp/print_jcp.vue"
	import descr from "@/components/descr/descr.vue"
	import user_descr from "@/components/descr/user_descr.vue"
	import printList from "@/components/print_jcp/printList.vue"
	import xinjinheader from "@/components/xinjin-header/xinjin-header.vue"
	import buhuo from "@/components/goods/buhuo.vue"
	export default{
		name:'sell',
		components: {
			prinr_select,pages ,empty,person_admin,verify_ordero,goods_record,
			user_select,shopping_admin,userGoodsRecord,countdown,
			sales_plan,max_out_plan,print_jcp,goodsImage,descr,user_descr,
			printList,xinjinheader,cz_record,buhuo
		},
		data(){
			return{
				caogaoCheckbox:{
					selest:false,
					checkbox_status:[]
				},
				buhuo_list:[],
				buhuo_order_id:'',
			
				UserEventListener:false,//搜索框的置入焦点
				orderShowProfit:false,
				search_list_old:[],
				qrCode:{
					key:-1,
					value:'',//扫描框内容
					focus:true,//焦点
					goodsIndex:-1,//当前扫码的商品索引
					orderIndex:-1,//当前扫码的商品索引
					//当前扫描中商品时的索引
					selectCss:'animation-name: selecruser;animation-duration: 500ms;animation-iteration-count: 1;',
				},
			
				search:{
					goods_value:'',//草稿单的搜索商品
					order_id:'',//订单号
					isCheckKC:'',//是否只显示有库存
				},

				openPlan:{//1=秒杀 2=满送
					type:'1',
					id:''
				},
				verifyOrdero:{//需要传递到单据流水页面的参数
					name:'',
					user_id:''
				},
				pageSend:{
					name:'',
					goods_id:''
				},
				pageSearch:{//欲要传递到用户详情页面搜寻的内容
					user_id:'',
					name:'',
					type:0
				},
				pageGoodsSearch:{//欲要传递到用户详情页面搜寻的内容
					GoodsId:'',
					name:''
				},
				single:'',
				kh:{//客户相关
					diaoBoWord:'',
					search:{// 搜索栏
						focus:false,//是否获得焦点
						word:'',//搜索内容
					},
					userData:{
						show:false,
						data:{
							data:{
								
							}
						}
					},
				},
				cgd:{//草稿单
					resData:{
						list:[],
						order:{
							id:'',//已经下单区
							
						}
					},
					status:'lessen',//magnify=放大 lessen=缩小
					
				},
				prepareSendOrder:{//准备下单区
					count:{
						value:'',
						focus:false,//是否获得焦点
					},
					money:{
						value:'',
						focus:false,//是否获得焦点
						selectEnd:0,
					},
					descr:{
						value:'',
					},
					item:{},
					bare_money:{
						value:'',
						focus:false,//是否获得焦点
						selectEnd:0,
					},
					pifajia:{
						value:'',
						focus:false,//是否获得焦点
						selectEnd:0,
					},
				},
				sp:{//商品列表区
					search:{// 搜索栏
						focus:false,//是否获得焦点
						word:'',//搜索内容
						screen:1,//搜索方式
						selectEnd:0,
						gys:'',//指定供应商
					},
					screen:{//搜索方式的下拉选择框
						now_id:'',
						list:[
							{
								text:'品名',
								value:'1',
							},
							{
								text:'货位',
								value:'2',
							},
						]
					},
					page:{
						nowPage:1,//当前页数
						pageCount:1,//总页数
						maxCount:0,
						sum:0,
						pageCounts:15,
					},
					resData:{
						list:[]
					},
					sortValue:'',//排序方式
					nowGoodsId:-1,//当前选中的列表项
				},
				sp_record:{//商品销售记录
					show:false,
				},
				mune:{
					index:2,
					diandan:{
						
					},
					caogao:{
						route:{
							now_id:'',
						},
						resData:{},
					},
					lishi:{
						load : false,
						date:[],//其实筛选
						page:{
							
							nowPage:1,//当前页数
							pageCount:1,//总页数
							maxCount:0,
							sum:0,
							pageCounts:15,
						},
						resData:{
							list:[]
						},
						checked:-1,
					},
				},
				guozhang:{//0=未过账 1=现金过账 2=微信过账 3=支付宝过账 4=网银过账
					money_type:{
						list:[
							{
								value:1,
								text:'现金'
							},
							{
								value:2,
								text:'微信'
							},
							{
								value:3,
								text:'支付宝'
							},
							{
								value:4,
								text:'网银'
							},
						],
						now_id:0,//当前选中
					},
					value:'',

				}
			}
		},
		 // 此处定义传入的数据
		props: {
			/**
			 * 是否显示线路选择框
			*/
			showRoute: {
				type:Boolean,
				default :true
			},
			/**
			 * 是否搜索正在开单中
			*/
			showBilling: {
				type:Boolean,
				default :true
			},
			/**
			 * 是否搜索供应商
			*/
			showGongYing: {
				type:Boolean,
				default :false
			},
			showDiaobo:{
				type:Boolean,
				default :false
			}
		},
		computed: {
			canPublish(){
				return this.caogaoCheckbox.checkbox_status.length<=0;
			},
		},
		mounted() {
			var that = this
			
			//为输入框增加键盘弹起事件处理程序
			this.$el.addEventListener('keyup', ()=>{
				if(that.UserEventListener == false){
					return
				}
				
				// console.log('输入框增加键盘弹起事件处理程序', event.key);
			  //,ArrowDown=下；ArrowUp=上;ArrowRight=右
				
					
				if(event.key == 'ArrowDown' && that.sp.resData.list.length>0 && that.mune.index==1){
					
					var index = that.sp.nowGoodsId
					
					index++;
					if(index>=that.sp.resData.list.length){
						index = 0;
					}
					that.fun_select_goods(that.sp.resData.list[index],index)

				}else if(event.key == 'ArrowUp' && that.sp.resData.list.length>0 && that.mune.index==1){
				
					
					var index = that.sp.nowGoodsId
					
					index--;
					if(index < 0){
						index = that.sp.resData.list.length-1;
					}
					that.fun_select_goods(that.sp.resData.list[index],index)
					
				}else if(event.key == 'ArrowRight' && that.sp.resData.list.length>0 && that.mune.index==1){
					//that.onclickUser( that.sp.resData.list[that.sp.nowGoodsId])
				}
					
				
			});

		},
	
		onReady() {
			// 在页面卸载时移除事件监听，避免内存泄露
			window.removeEventListener('resize', this.handleResize);
		},
		
		created() {
			var that = this

			let route = that.$routeData.GetNowRoute()

			that.mune.caogao.route.now_id     = route
			this.onMenuClick(2)
			this._init_search()
		
		},
		
		methods:{
			showSelectOrderMode(event){
				console.log('event',event)
				var that = this
				var itemList = [];
				itemList.push("销售单模板(默认)")
				itemList.push("销售单模板(留底)")
				if(this.showGongYing ==true){
					itemList.push("进货单")
					itemList.push("进货单 - 二维码转发")
				}
				var orderId = this.cgd.resData.order.id
				
				uni.showActionSheet({
					itemList:itemList,
					popover:{
						left:event.detail.x,
						top:event.detail.y,
					},
					success: (res) => {
						var tapIndex = res.tapIndex
						if(tapIndex == 0){
							that.$common.GetOrder(orderId,false,1)
							return
						}
						else if(tapIndex == 1){
							that.$common.GetOrder(orderId,false,2)
							return
						}
						else if(tapIndex == 2){
							that.$common.GetOrder(orderId,false,3)
							return
						}
						else if(tapIndex == 3){
							that.$common.GetOrder(orderId,false,4)
							return
						}
						
					}
				})
			},
			//草稿单 全选中
			caogaoCheckboxChoose_all(){
				this.caogaoCheckbox.checkbox_status = []
				if(this.caogaoCheckbox.select  == false){
					this.caogaoCheckbox.select = true
					for (var i=0;i<this.mune.caogao.resData.list.length;i++) {
						this.caogaoCheckbox.checkbox_status.push(this.mune.caogao.resData.list[i].id)
					}
				}else{
					this.caogaoCheckboxChoos_all_close()
				}
			},
			// 取消全选中
			caogaoCheckboxChoos_all_close(){
				this.caogaoCheckbox.checkbox_status = []
				this.caogaoCheckbox.select = false
			},
			//草稿单 回调当前选中的表项
			caogaoCheckbox_change(e){
				this.caogaoCheckbox.checkbox_status = e.detail.value
			},
			//草稿单 汇总表打印
			openOrderList(mode){
				var that = this
				if(this.caogaoCheckbox.checkbox_status.length<=0){
					this.$common.toast('请先勾选需要操作的单据后再进行云打印总表')
					return;
				}
				uni.showModal({
					content: '是否确定将勾选的单据进行打印？',
					success: function (res) {
						if (res.confirm) {
							var jsonData = JSON.stringify(that.caogaoCheckbox.checkbox_status)
							that.$common.get_request(
								{
									type:'printOrderStatus',
									json_data:jsonData,
									mode: mode,
								},
								(res)=>{
									that.$common.toast(res.msg)
								},()=>{
									that.caogaoCheckboxChoos_all_close()
								}
							);
						}
					}
				});
			},
			onClickYH(){
				var that = this
				uni.showModal({
					title:'请输入对此订单优惠减免的金额',
					mask:true,
					editable:true,
					content:'',
					placeholderText:'输入金额',
					success:(res)=>{
						if(res.confirm ){
							if(res.content.length<=0){
								that.$common.showModal("未输入金额")
								return
							}
							var money = res.content
							that.prepareSendOrder.money.value = money
							that.prepareSendOrder.count.value = 1
							
							that.prepareSendOrder.bare_money.value = money
							that.prepareSendOrder.pifajia.value = money
							
							that.funCreateOrder(15,1,'')
						}
					}
				})
				
			},
			
			on_goods(list){
				this.buhuo_list = list
				this.buhuoXunhuan()
			},
			buhuoXunhuan(){
				if(this.buhuo_list.length<=0){
					return
				}
	
				var id = this.buhuo_list[this.buhuo_list.length -1].id
				var count = this.buhuo_list[this.buhuo_list.length -1].count
				
				var orderId = this.buhuo_order_id
				var user_id  = this.kh.userData.data.data.id
				
				this.buuho(id,orderId,count,user_id,(res)=>{
					this.buhuo_order_id = res.order_id
					this.buhuo_list.splice(this.buhuo_list.length -1,1)
					if(this.buhuo_list.length<1){
						this.funCreateOrderList(orderId)
						this.$refs.goods_buhuo.close()
						
					}else{
						this.buhuoXunhuan()
						
					}
				})	
				
				
			},
			buuho(goods_id,orderId,count,user_id,call){
				var that = this
				that.$common.get_request(
					{
						type:'create_order',
						goods_id:goods_id,
						order_id: orderId,
						types: 5,//区分进货还是销售
						money: 0,
						count: count,
						user_id: user_id,
						descr:'',
						bare_money:0,
						pifajia:0,
					},
					(res)=>{
						call(res)
						
					},()=>{
						
					}
				);
			},
			// 计算结余金额
			calculateBalance(jiude,newAmount) {
			  if (!newAmount) return "0.00";
			  const balance =   parseFloat(newAmount) + jiude;
			  return balance.toFixed(2);
			},
		
	
		
			GoodsSearchSelectUser(){
				if( this.kh.userData.data.data==undefined){
					var uid = ""
				}else if( this.kh.userData.data.data.id==undefined){
					var uid = ""
				}else{
					var uid = this.kh.userData.data.data.id
				}
				this.sp.search.gys = uid
				this.fun_goods_all()
			},
			isCheckKCFnu(res){
				this.search.isCheckKC = res.detail.value
			},
		
			
			/**
			 * 读取缓冲的搜索记录
			*/
			_init_search() {
				var that = this
				
				uni.getStorage({
					key: '_init_search',
					success: (res) => {
						that.search_list_old = JSON.parse(res.data); //更新历史搜索
					}
				});
			},
			/**
			 * 读取缓冲的搜索记录
			*/
			_search_list_oldShow() {
				var that=this
				this.saveKeyword(this.sp.search.word)
				this.$nextTick(()=>{
					
				})
			},
			/**
			 * 保存缓冲的搜索记录
			*/
			saveKeyword(search_input) {
				var that    = this
			
				
				that.isShow = false
				if (search_input) {
					
					
					
					//缓存KEY
					var store_key = '_init_search'
					
					uni.getStorage({
						key: store_key,
						success: (res) => {
							var old_data = JSON.parse(res.data);
							
							var findIndex = old_data.indexOf(search_input);
							if (findIndex == -1) {
								old_data.unshift(search_input);
							} else {
								old_data.splice(findIndex, 1);
								old_data.unshift(search_input);
							}
							
							//最多10个纪录
							old_data.length > 10 && old_data.pop();
							uni.setStorage({
								key: store_key,
								data: JSON.stringify(old_data)
							});
							that.search_list_old = old_data; //更新历史搜索
							
						},
						fail: (e) => {
							var old_data = [search_input];
							uni.setStorage({
								key: store_key,
								data: JSON.stringify(old_data)
							});
							that.search_list_old = old_data; //更新历史搜索
						}
					});
				}
			},
					
			xianluxuanze(e){
				this.$routeData.SetNowRoute(e)
				this.fun_GetMenuCaogao()
			},
			//回调第一个时间
			changeStartDate(res){
				this.mune.lishi.date[0] = res.detail.value
				this.$set(this.mune.lishi.date,0,this.mune.lishi.date[0])
				//this.fun_Getlishi_list(true)
			},
			//回调第二个时间
			changeEndDate(res){
				this.mune.lishi.date[1] = res.detail.value
				this.$set(this.mune.lishi.date,1,this.mune.lishi.date[1])
			},
		
			//打开图片查看器
			OpenModulesImage(index){
				this.$refs.modulesImage.imageOpen(false,index)
			},
			//图片查看器的回调索引
			goodsPreviewImageIndex(res){
				var index = res.value
				this.sp.nowGoodsId = index
				this.fun_select_goods(this.sp.resData.list[index],index,false)
			},
			
			/**
			 * 单条数据打印
			*/
			OnOrderPrint(OrderId,immediate){
				var that = this

				that.fun_order_print(3,OrderId,immediate,(res)=>{
					that.cgd.resData.order.print_count = 1
				})
			},
			/**
			 * 单条数据审核
			*/
			OnOrderAudit(OrderId){
				var that = this

				that.fun_order_audit(2,OrderId,(res)=>{
					that.cgd.resData.order.type = res.type
				})
			},
		
			/**
			 * 打开活动详情
			*/
			openPlanPages(type,PlanId){
				this.openPlan.type=type
				this.openPlan.id = PlanId
				this.$refs.pagePlan.open()
			},
			/**
			 * 下单时，在输入下单数量后回车辉触发此处
			*/
			orderConfirmCount(){
				// 允许修改价格,置焦点至价格输入框
				this.prepareSendOrder.count.focus=false
				this.prepareSendOrder.money.focus=true
			},
			
			/**
			 * 关闭商品历史记录
			*/
			goodsRecordClose(){
				this.sp_record.show = false
			},
			/**
			 * 加载商品历史记录
			*/
			goodsRecordLoad(goods_id){
				this.sp_record.show = true
				this.pageGoodsSearch.GoodsId = goods_id
				//uni.$emit('goodsRecord',{goods_id:goods_id})
			},
			/**
			 * 弹出单据流水
			 * 
			*/
			openPageVerifyOrdero(name,user_id){
				this.verifyOrdero.name = name
				this.verifyOrdero.user_id = user_id
				this.$refs.verifyOrdero.open()
			},
			/**
			 * 弹出客户详情页
			*/
			openPageAadmin(user_id,name){
				this.pageSearch.user_id = user_id
				this.pageSearch.name = name
				this.pageSearch.type = this.showGongYing==true?'gys':(this.showDiaobo==true?'db':'kh')
				
				
				this.$refs.page_admin.open()
			},
		
			/**
			 * 菜单被点击，跑到某个菜单是否已经加载。未加载的话就尝试加载
			*/
			onMenuClick(index){
				this.mune.index = index
				if(index == 1 && this.sp.page.sum == 0){
					this.fun_goods_all(true);
					
				}else if(index == 2){
					this.fun_GetMenuCaogao()
					
				}else if(index == 3 && this.mune.lishi.load == false){
					this.fun_Getlishi_list(true);
					this.mune.lishi.load = true
					
				}
				
			},
			/**
			 * 详细草稿列表-点击商品
			 * 赋值到搜索框，以及获取此商品历史
			 * 
			*/
			onclickCaogaoGoodinfo(index){
				var item = this.cgd.resData.list[index]
				var name = item.goods.name
				var goodsId = item.goods.id
				
				this.sp.search.word  = name
				
				this.searchGoodsInputFocus(true)

				this.pageGoodsSearch.GoodsId= goodsId
				
				this.goodsRecordLoad(goodsId)
			},
	
			/**
			 * 草稿单-删除
			*/
			order_all_delete(order_id){
				var that = this
				if(that.cgd.resData.order == undefined){
					return
				}
				uni.showModal({
					content: '是否确定删除？此操作不可逆。删除后有关信息无法恢复！',
					success: function (res) {
						if (res.confirm) {
							that.$common.get_request(
								{type:'order_all_delete',order_id:order_id},
								(res)=>{
									that.cgd.resData.list=[]
									that.cgd.resData.order.id = ''
									that.cgd.status = 'lessen'
								}
							);
						}
					}
				});
			},


			/**
			 * 草稿单-打印
			 * type : 1=全部打印 2= 指定打印 ，此时orderId不能为空
			 * 
			*/
			fun_order_print(type=1,orderId='',immediate,callback){
				var that = this
				if(that.cgd.resData.order == undefined){
					return
				}
				var arr = [];
				//区分来自于全部，单条
				if(type==1){
					if(this.caogaoCheckbox.checkbox_status.length<=0){
						this.$common.toast('请先勾选需要操作的单据后再进行云打印')
						return;
					}
					uni.showModal({
						content:'是否确定将勾选的单据进行打印？',
						success: (res) => {
							if (res.confirm) {
								var jsonData = JSON.stringify(that.caogaoCheckbox.checkbox_status)
								that.orderPrintSend(jsonData,immediate,callback)
							}
						}
					})
					
					
					
				}else if(type==2){
					if(orderId.length == 0){
						that.$common.toast('失败，没有指定草稿')
						return
					}

					arr.push(orderId)
					if(that.mune.caogao.resData.list.length>0){
						that.mune.caogao.resData.list.forEach((item,index)=>{
							if(item.id == orderId){
								if(that.mune.caogao.resData.list[index].print_count>=1){
									uni.showModal({
										content:'此单据已打印，是否继续打印？',
										success: (res) => {
											if (res.confirm) {
												that.mune.caogao.resData.list[index].print_count++
												
												var jsonData = JSON.stringify(arr)
												that.orderPrintSend(jsonData,immediate,callback)
											}
										}
									})
								}else{
									that.mune.caogao.resData.list[index].print_count++
									var jsonData = JSON.stringify(arr)
									that.orderPrintSend(jsonData,immediate,callback)
								}
								return
							}
						})
					}
				}else if(type==3){
					if(orderId.length == 0){
						that.$common.toast('失败，没有指定草稿')
						return
					}
					var orderId = that.cgd.resData.order.id
					arr.push(orderId)
					
					if(that.cgd.resData.order.print_count>=1){
						uni.showModal({
							content:'此单据已打印，是否继续打印？',
							success: (res) => {
								if (res.confirm) {
									that.cgd.resData.order.print_count++
									var jsonData = JSON.stringify(arr)
									that.orderPrintSend(jsonData,immediate,callback)
								}
							}
						})
					}else{
						that.cgd.resData.order.print_count++
						var jsonData = JSON.stringify(arr)
						that.orderPrintSend(jsonData,immediate,callback)
					}
					return
				}
				
				
				
			
				
			},
			orderPrintSend(jsonData,immediate,callback){
				this.$refs.prinrSelectBox.open(jsonData,immediate)
				
			},
			calculatePercentage(partialValue, totalValue) {
			    if (totalValue === 0 || isNaN(partialValue) || isNaN(totalValue)) {
			        return 0; // 防止除以0的错误，如果总值为0或者有任何一个值是NaN，则返回0
			    }
			    return (partialValue / totalValue) * 100;
			},
			 
		
			/**
			 * 回款
			*/
			fun_user_income(){
				var that = this
				
				that.$common.get_request(
					{
						type:'user_income',
						uid:that.kh.userData.data.data.id,
						money:that.guozhang.value,

						// money_type:that.guozhang.money_type.now_id,
					},
					(res)=>{
						that.$common.toast("成功")
						that.guozhang.value = ''
						that.user_info(that.kh.userData.data.data.id)
					}
				);
			},

			/**
			 * 过账
			*/
			fun_user_gz(id){
				var that = this
				if(that.cgd.resData.order == undefined || that.cgd.resData.order.id==undefined){
					that.$common.toast("未选中需要过账的单据无法过账")
					return
				}
				var arr  = []
				arr.push(that.cgd.resData.order.id)
				var json_data = JSON.stringify(arr)
				that.$common.get_request(
					{
						type:'user_gz',
						json_data:json_data,
					},
					(res)=>{
						that.$common.toast("成功")
						that.guozhang.value = ''
						that.user_info(that.kh.userData.data.data.id)
						that.cgd.resData.list=[]
						that.cgd.resData.order.MselectEnd=''
						that.cgd.resData.order.id=''
						that.cgd.resData.order.selectEnd=''
					}
				);
			},
		
			

			
			/**
			 * 分页器回调
			 * 
			*/
			updatePage_lishi(pageName,pageCount){
				var that = this
				that.mune.lishi.page.nowPage = pageName
				that.mune.lishi.page.pageCounts = pageCount
				that.fun_Getlishi_list(false)
			},
			
			/**
			 * 历史-获取列表
			*/
			fun_Getlishi_list(isUpdatePage=true){
				var that = this
				if(!that.kh.userData.data.data){
					that.$common.toast("未有选择需要查看历史单的用户，请先选择后再试")
					return
				}	
				that.mune.lishi.page.nowPage = isUpdatePage==true ? 1:that.mune.lishi.page.nowPage;
					
				that.mune.lishi.resData = {}
				//日期构建
				if(that.mune.lishi.date.length>=2){
					var start_date = that.mune.lishi.date[0]
					var end_date = that.mune.lishi.date[1]
				}else{
					var start_date = ''
					var end_date = ''
				}
				
				that.$common.get_request(
					{
						type:'order_all_admin',
						accomplish:2,
						uid: that.kh.userData.data.data.id,
						start_date: start_date,
						end_date: end_date,
						goods_value:that.search.goods_value,
						show_goods_list:0,
						pages:that.mune.lishi.page.nowPage,//当前位于页数
						page_count:that.mune.lishi.page.pageCounts,//当前请求页的数量
					},
					(res)=>{
						that.mune.lishi.resData = res
						
						that.mune.lishi.page.pageCount  = res.pageCount
						that.mune.lishi.page.sum  = res.sum
						if(isUpdatePage == true){
						that.mune.lishi.page.nowPage  = 1
						}
						that.mune.lishi.page.maxCount  = res.maxCount
						
					}
				);
			},
			/**
			 * 订单锁定
			*/
			orderLockFun(orderId){
				var that = this
				that.$common.get_request(
					{
						type:'order_lock',
						order_id:orderId,
					},
					(res)=>{
						that.cgd.resData.order.lock = res.value
						that.$common.toast(res.msg)
					}
				);
			},
			/**
			 * 订单撤回
			*/
			orderBack(orderId){
				var that = this
				uni.showModal({
					content:'确定进行退单吗？退单后可以重新修改单据价格、增加、减少单据商品。',
					success: (res) => {
						if (res.confirm) {
							that.$common.get_request(
								{
									type:'order_back',
									order_id:orderId,
								},
								(res)=>{
									that.user_info(that.kh.userData.data.data.id)
									that.funCreateOrderList(orderId)
								}
							);
						}
					}
				})
			},
			/**
			 * 草稿单-审核-拣货
			 * type : 1=全部 2= 指定 ，此时orderId不能为空
			*/
			fun_order_audit(type=1,orderId='',callback){
				var that = this
				var arr = [];
				//区分来自于全部审核，单条审核
				if(type==1){
					if(that.mune.caogao.resData.list == undefined ){
						return
					}
					for(var i=0;i<that.mune.caogao.resData.list.length;i++){
						//置颜色
						that.mune.caogao.resData.list[i].type = 1
					}
					
					arr = that.caogaoCheckbox.checkbox_status
					
				}else{
					if(that.cgd.resData.order == undefined ){
						return
					}
					if(orderId.length == 0){
						that.$common.toast('失败，没有指定草稿')
						return
					}
					arr.push(orderId)
					
					if(that.mune.caogao.resData.list != undefined  && that.mune.caogao.resData.list.length>0){
						that.mune.caogao.resData.list.forEach((item,index)=>{
							if(item.id == orderId){
								that.mune.caogao.resData.list[index].type =1
								return
							}
						})
					}
				}
				
				var jsonData = JSON.stringify(arr)
				that.$common.get_request(
					{
						type:'order_audit',
						json_data:jsonData,
					},
					(res)=>{
						if(type==1){
							that.fun_GetMenuCaogao()
						}
						if(callback){
							callback(res)
						}
						that.$common.toast(res.msg)
					}
				);
			},
			
			/**
			 * 草稿-获取
			*/
			GetOrderBody(){
				var that = this
				return {
						type:'order_all_admin',
						types: 2,//1=客户 2=线路
						isprint: 1,//2=已打印 3=未打印
						route_id:that.showGongYing==true || that.showDiaobo == true? '':that.mune.caogao.route.now_id,//区分供应商草稿单不应该存在线路ID
						accomplish:3,//是否已过账 0=开单中 1=拣货中 2=已过账 3=不等于2
						supplier:that.showGongYing==true ? 2:(that.showDiaobo == true ? 3:0),//区分供应商草稿单
						goods_value: that.search.goods_value,
						order_id: that.search.order_id,
						show_goods_list:0,
						
					};
			},
			/**
			 * 草稿-获取
			*/
			fun_GetMenuCaogao(){
				var that = this
				this.caogaoCheckboxChoos_all_close()
				that.mune.caogao.resData = {}
				that.$common.get_request(
					that.GetOrderBody(),
					(res)=>{
						that.mune.caogao.resData = res
					}
				);
			},
			/**
			 * 草稿-被点击
			 * 获取客户个人信息及当前草稿单详细内容
			*/
			fun_orderOnClick(order_id,user_id){
				
				this.funCreateOrderList(order_id)
				this.user_info(user_id)
				
				this.searchGoodsInputFocus()
				this.goodsRecordClose()
			},
			/**
			 * 搜索框置入焦点
			*/
			searchGoodsInputFocus(forceGoodsFocus=false){
				this.prepareSendOrder.pifajia.focus = false
				this.prepareSendOrder.bare_money.focus = false
				this.prepareSendOrder.money.focus = false
				this.prepareSendOrder.count.focus = false
				
			},
			
			/**
			 * 草稿单-下单前检查
			*/
			staratMoneyCreateOrder(types){
				if(this.showGongYing == true){
					this.prepareSendOrder.count.focus=false
					this.prepareSendOrder.money.focus=false
					this.prepareSendOrder.pifajia.focus=false
					this.prepareSendOrder.bare_money.focus=true
				}else{
					this.funCreateOrder(types,this.sp.resData.list[this.sp.nowGoodsId].id,this.prepareSendOrder.descr.value)
				}
			},
			/**
			 * 草稿单-下单前检查
			*/
			staratBareMoneyCreateOrder(types,event){
				this.prepareSendOrder.count.focus=false
				this.prepareSendOrder.money.focus=false
				this.prepareSendOrder.bare_money.focus=false
				this.prepareSendOrder.pifajia.focus=true
			},
			/**
			 * 草稿单-下单
			*/
			funCreateOrder(types,goods_id,descr){
				
				var that = this
				if(that.kh.userData.data.data ==undefined){
					that.$common.toast("未选择客户，无法下单")
					return
				}
				
				that.prepareSendOrder.money.focus=false
				that.goodsRecordClose()
				if(that.cgd.resData.order==undefined || that.cgd.resData.order.id == undefined || that.cgd.resData.order.id.length<=0){
					var orderId = ''
				}else{
					var orderId = that.cgd.resData.order.id
				}
				//区分进货、销售、退货打回
				var typesTmp = types
				if(that.showGongYing==true){
					if(types!=6 && types!=4&& types!=13&& types!=15){
						typesTmp = 5
					}else{
						typesTmp = types
					}
				}
				if(that.orderCheckGoods(goods_id,typesTmp) == true){
					uni.showModal({
						title: '提示',
						content: '此商品已经存在草稿单中，是否继续下单？',
						success: function (res) {
							if (res.confirm) {
								that.sendOrder(goods_id,orderId,typesTmp,descr);
							} 
						}
					});
					
				}else{
					that.sendOrder(goods_id,orderId,typesTmp,descr);
				}
				
				
				
			},
			orderCheckGoods(goods_id,typesTmp){
				var that = this

				for(var i=0;i<that.cgd.resData.list.length;i++){
					
					if(that.cgd.resData.list[i].goods_id == goods_id && that.cgd.resData.list[i].type == typesTmp){
						return true;
					}
				}
				return false;
			},
			sendOrder(goods_id,orderId,typesTmp,descr){
				var that = this
				that.$common.get_request(
					{
						type:'create_order',
						goods_id:goods_id,//
						order_id: orderId,//
						types: typesTmp,//区分进货还是销售
						money: that.prepareSendOrder.money.value,//
						count: that.prepareSendOrder.count.value,//
						user_id: that.kh.userData.data.data.id,
						descr:descr,//
						bare_money:that.prepareSendOrder.bare_money.value,//
						pifajia:that.prepareSendOrder.pifajia.value,//
				
					},
					(res)=>{
						that.cgd.resData.order.id = res.order_id
						that.funCreateOrderList(that.cgd.resData.order.id)
				
						that.searchGoodsInputFocus(true)
					
						that.prepareSendOrder.count.value = ""
					}
					,()=>{
						that.searchGoodsInputFocus(true)
					}
				);
			},
			/**
			 * 草稿单-获取
			*/
			funCreateOrderList(order_id){
				var that = this
				
				
				
				that.prepareSendOrder.money.focus=false
				that.$common.get_request(
					{
						type:'create_order_list',
						order_id: order_id,
					},
					(res)=>{
						res.list.forEach((item, index) => {
							item.pifajia = (item.pifajia)
							item.jinhuojia = (item.jinhuojia)
							item.money = (item.money)
							item.sum_money = (item.sum_money)
							
							if(item.goods.pifajia!=undefined){
								item.goods.pifajia = (item.goods.pifajia)
								item.goods.jinhuojia = (item.goods.jinhuojia)
							}
						});
						that.cgd.resData = res
						
						that.searchGoodsInputFocus()
						
				
					}
				);
			},
			
			/**
			 * 草稿单-新增单据
			*/
			fun_order_add(){
				var that = this
				that.cgd.resData.order = {}
				that.cgd.resData.list  = []
				
				that.searchGoodsInputFocus(true)
			},
			/**
			 * 草稿单-删除商品
			*/
			fun_order_delete(index){
				var that = this
				let order_ids = that.cgd.resData.list[index].id
				that.$common.get_request(
					{
						type:'order_delete',
						order_ids:order_ids,
					},
					(res)=>{
						that.cgd.resData.list.splice(index,1)
						that.funCreateOrderList(that.cgd.resData.order.id)
					}
				);
			},
			/**
			 * 草稿单-修改参数
			*/
			fun_order_update(item,scene,value,success){
				var that = this
				//先删除
				if(scene=='money'){
					var body = JSON.parse(JSON.stringify(item))
					body.types = item.type
					body.type  = 'order_update'
					
					that.$common.get_request(
						body,
						(res)=>{
							that.cgd.resData.order.id = res.order_id
							that.funCreateOrderList(that.cgd.resData.order.id)
							if(success){
								success()
							}
						}
					);
					return
				}else if(scene=='descr'){
					//备注修改
					that.$common.get_request(
						{
							type:'orderUpdateDescr',
							order_ids:item.id,
							value:value,
						},
						(res)=>{
							that.funCreateOrderList(that.cgd.resData.order.id)
							if(success){
								success()
							}
						}
					);
				}else if(scene=='bare_money'){
					//裸价 修改
					that.$common.get_request(
						{
							type:'orderUpdateBareMoney',
							order_ids:item.id,
							value:value,
						},
						(res)=>{
							that.funCreateOrderList(that.cgd.resData.order.id)
							if(success){
								success()
							}
						}
					);
				}else if(scene=='pifajia'){
					//批发价 修改
					that.$common.get_request(
						{
							type:'orderUpdatepifajia',
							order_ids:item.id,
							value:value,
						},
						(res)=>{
							that.funCreateOrderList(that.cgd.resData.order.id)
							if(success){
								success()
							}
						}
					);
				}
			},
			/**
			 * 分页器回调
			 * 
			*/
			updatePage(pageName,pageCount){
				var that = this
				
				that.sp.page.nowPage = pageName
				that.sp.page.pageCounts = pageCount
				that.fun_goods_all(false,false)
			},
			
			/**
			 * 用户 -选择了某个
			*/
			selectUser(item){
				if(item==null){
					return
				}
				var that = this

				//切换回下单界面
				that.mune.index = 1
				that.searchGoodsInputFocus(true)
				
				// that.fun_goods_all(true)
					
				that.user_info(item.id)
				
				that.searchGoodsInputFocus()

				
				if(item.caogao !=undefined && item.caogao.id){
					that.funCreateOrderList(item.caogao.id)
					
				}else{
					that.cgd.resData.order.MselectEnd = ''
					that.cgd.resData.order.id = ''
					that.cgd.resData.order.selectEnd = ''
					
					that.cgd.resData.list  = []
				}
				that.kh.userData.data.data.id = item.id
			},
			diaoboLib(){
				var that = this
				this.user_info(this.kh.diaoBoWord,true,(res)=>{
					
				})
			},
			/**
			 * 用户-查询某个信息
			*/
			user_info(uid,isDiaobo=false,callback){
				var that = this
				var data = {
						type:'user_info',
						uid:uid,//搜索内容
					}
				if(isDiaobo){
					data.diaobo = 1
				}
				//初始化历史单据
				that.mune.lishi.load = false
				that.$common.get_request(
					data,
					(res)=>{
						
						that.kh.userData.data = res
						//提取客户线路名称
						that.kh.userData.data.data.route_name = that.onclickRoute(that.kh.userData.data.data.route_id)
						if(callback){
							callback(res)
						}
					}
				);
			},
			/**
			 * 获取线路
			*/
			onclickRoute(id){
				var tmpArr = this.$routeData.getRoute()
				
				for (var i=0;i<tmpArr.length;i++) {
					if(tmpArr[i].value == id){
						return tmpArr[i].text
					}
				}
				return '-'
			},
			onSearchInput(){
				var that = this
				that.sp.sortValue = ''
				that.fun_goods_all(true)
			},
			/**
			 * 商品-读取搜索
			*/
			fun_goods_all(isUpdatePage=true,updateHeader=true){
				var that = this
				
				that.sp.nowGoodsId=-1//初始化列表选中项
				that.sp.page.nowPage = isUpdatePage==true ? 1:that.sp.page.nowPage;
				//初始化回到商品展示页面
				that.mune.index=1
				that.sp.resData.list = []
				if( that.kh.userData.data.data==undefined){
					var uid = ""
				}else if( that.kh.userData.data.data.id==undefined){
					var uid = ""
				}else{
					var uid = that.kh.userData.data.data.id
				}

			
				that.$common.get_request(
					{
						type:'goods_list',
						search:that.sp.search.word,//搜索内容
						screen: that.sp.screen.now_id,//搜索方式
						pages:that.sp.page.nowPage,//当前位于页数
						page_count:that.sp.page.pageCounts,//当前请求页的数量
						sort:that.sp.sortValue,//排序
						uid:uid,//当前客户
						isCheckKC:that.search.isCheckKC.length<=0?0:1,
						gongyingId:that.sp.search.gys,
						
					},
					(res)=>{
						res.list.forEach((item, index) => {
							item.pifajia = parseFloat(item.pifajia)
							item.jinhuojia = parseFloat(item.jinhuojia)
						});
						that.sp.resData = res
						
						
						that.sp.page.pageCount  = res.pageCount
						that.sp.page.sum  = res.sum
						if(isUpdatePage == true){
						that.sp.page.nowPage  = 1
						}
						that.sp.page.maxCount  = res.maxCount
						//默认选中第一个
						
						that.sp.nowGoodsId = -1
						that.searchGoodsInputFocus(true);
					
					}
				);
			},

			/**
			 * 商品-选中某条
			*/
			fun_select_goods(item,index,loadRecord=true){
				var that = this
				
				that.prepareSendOrder.money.value = ''
				that.prepareSendOrder.count.value = ''
				that.prepareSendOrder.descr.value = item.descr
				that.prepareSendOrder.bare_money.value = ''
				that.prepareSendOrder.pifajia.value = ''
				
				that.prepareSendOrder.item = item
			
				if(that.showGongYing == false)
				{
					//销售的
					if(item.plan.status==true){
						//秒杀的活动价格
						that.prepareSendOrder.money.value = item.plan.data.money
					
					}else{
						//检查是否有价格跟踪
						if(that.sp.resData.list[index].TrackingPrice.status==true){
							that.prepareSendOrder.money.value = that.sp.resData.list[index].TrackingPrice.money
							//that.prepareSendOrder.count.value = that.sp.resData.list[index].TrackingPrice.counts
						}else{
							//正常的价格，没有活动
							that.prepareSendOrder.money.value = that.sp.resData.list[index].pifajia
						}
					}
					
				}else{
					//进货的
					that.prepareSendOrder.bare_money.value = that.sp.resData.list[index].bare_money
					that.prepareSendOrder.money.value = that.sp.resData.list[index].jinhuojia
					that.prepareSendOrder.pifajia.value = that.sp.resData.list[index].pifajia
				}
				
				that.sp.nowGoodsId = index
		
				that.pageGoodsSearch.GoodsId = that.sp.resData.list[index].id
				
				that.prepareSendOrder.money.selectEnd = (that.prepareSendOrder.money.value + '').length
				that.prepareSendOrder.bare_money.selectEnd = (that.prepareSendOrder.bare_money.value + '').length
				that.prepareSendOrder.pifajia.selectEnd = (that.prepareSendOrder.pifajia.value + '').length
				
				if(loadRecord == true){
					that.goodsRecordLoad(that.sp.resData.list[index].id)
				}
				
				that.prepareSendOrder.money.focus = false
				that.prepareSendOrder.count.focus = true
			},
		}
	}
</script>

<style>
	.goodsSearchBox{
		position: absolute;
		bottom: 0px;
		width: calc(100% - 20px);
		display: flex;
		flex-direction: row;
		height: 46px;
	}
	.wed{
		padding: 5px 10px;
		/* margin-bottom: 5px; */
		margin-top: 0px;
		display: flex;
		width: calc(100% - 20px);
		height: 32px;
		/* background-color: #001529ad; */
		/* color: #fff; */
	}
	.orderAddTitle{
		font-size: 16px;
		padding: 10px 3px;
		background-color: #fff;
		margin-bottom: 20px;
	}
	.lock-ico:hover{
		border: solid 1px #a7a7a7;
		cursor: pointer;
	}
	.lock-ico{
		padding: 5px;
		margin: auto 20px auto auto;
		border-radius: 8px;
		width: 20px;
		height: 20px;
	}
	.huikuan{
		border-radius: 5px;
		margin: auto 0px;
		padding: 0px 5px;
		display: flex;
		justify-content: center;
		align-items: center;
		cursor: pointer;
		background: #0f66e0;
		color: #f9f9f9;
		height: 32px;
	}
	.qrcodeWidth{
		display: flex;
		justify-content: center;
		flex-direction: row;
		width: 20%;
		
	}
	.w70{
		    width: 70px;
		    min-width: 70px;
	}
	.qrcodeWidthBorder{
		border-width: 1px;
		border-style: solid;
		border-radius: 2px;
		justify-content: center;
		flex-direction: column;
		display: flex;
		text-align: center;
		background-color: #3e70ff;
		color: #fff;
		font-size: 14px;
		font-weight: 600;
		border: solid 1px #3333331c;
	}
	.layui-input {
	    margin: auto;
		display: flex;
		font-size: 14px;
	}
	.layui-input, .layui-btn, .layui-select {
	    height: 26px;
	}
	.layui-input, .layui-textarea {
	    display: block;
	    width: 100%;
	    padding-left: 10px;
	}
	.layui-input, .layui-select, .layui-textarea {
		margin: auto 0px;
	    background-color: #fff;
		border-width: 1px;
		border-style: solid;
		border-radius: 2px;
	}

	/* 扫描了闪烁 */
	.show-select{
		animation-name: selecruser;animation-duration: 500ms;animation-iteration-count: 1;
		/* background-color: #FF623E; */
	}
	@keyframes selecruser {
		0% {
			background-color: #dfdfdf;
			color: #333;
		}
		50%{
			background-color: #F52631;
			color: #fff;
			
		}
		100% {
			background-color: #dfdfdf;
			color: #333;
		}
	}
	.jiyi{
		/* z-index: 999; */
		position: absolute;
		width: 100%;
		background-color: #fff;
		height: 35px;
		top: -35px;
		left: 0px;
		justify-content: start;
		flex-direction: row;
		display: flex;
		width: calc(100% - 10px);
	    overflow: auto;
	}
	.jiyi::-webkit-scrollbar{
	    width:0px;
	    height:0px;
	}
	.dSLComVueLogBox {
		line-height: 24px;
		background-color: #e8e8e8;
		padding: 0px 15px;
		border-radius: 5px;
		flex: none;
		margin: 5px ;
		font-size: 12px;
		// border: 1rpx solid #ccc
	}
	
	.mytext {
		color: #333333;
	}
	.ChangeColor{
		background-color: #ffd0d0;
	}
	.ttt{
		width: 500px;
		height: 300px;
		background-color: #fff;
		color: #2d2d2d;
		border-bottom: solid 1px #d6d6d6;
		padding: 3px 10px;
	}
	.ttt .yyy{
		margin: 5px auto;
		justify-content: center;
		height: 40px;
		border-bottom: solid 1px #eee;
		padding-bottom: 5px;
	}
	.ttt .yyy .butt{
		font-size: 14px;
		padding: 5px 10px;
		font-weight: 600;
		border: solid 1px;
		display: flex;
		justify-content: center;
		flex-direction: column;
		text-align: center;
		margin: auto;
		cursor: pointer;
		border-radius: 8px;
		margin: auto 10px
	}
	.decsCount{
		background-color: #f00;
		border-radius: 50%;
		font-size: 9px;
		position: absolute;
		top: -5px;
		right: -5px;
		padding: 1px 3px;
	}

	.fenhuo2{
		width: 100%;
		border: aliceblue;
		padding: 0 2px;
		flex: 1;
		display: flex;
		text-align: center;
		width: 50px;
		border-radius: 8px;
		min-height: 30px;
		background-color: #FF4D4F;
		color:#fff;
		justify-content: center;
		flex-direction: column;
	}
	.fenhuo1{
		width: 100%;
		border: aliceblue;
		padding: 0 2px;
		flex: 1;
		display: flex;
		text-align: center;
		width: 50px;
		border-radius: 8px;
		min-height: 30px;
		background-color: #009434;
		color:#fff;
		justify-content: center;
		flex-direction: column;
	}
	.fenhuo{
		width: 100%;
		border: aliceblue;
		padding: 0 2px;
		flex: 1;
		display: flex;
		text-align: center;
		width: 50px;
		border-radius: 8px;
		min-height: 30px;
		background-color: #fff;
		justify-content: center;
		flex-direction: column;
	}
	.left-order{
		position: relative;
		margin: 10px;
		height: calc(100% - 20px);
		gap: 10px;
		display: flex;
		flex-direction: column;
		width: 50%;
	}
	.xd-box{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 10px;
		white-space: normal;
	}
	.xd-butt{
		flex-wrap: wrap;
		align-content: center;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: stretch;
	}
	.wh100{
		display: flex;
		flex-direction: column;
		height: inherit;
		width: 100%;
	}
	.wh100 .box-main{
		display: inline-block;
		height: auto;
		margin: 0px;
		padding: 0px 10px;
		position: relative;
		background-color: #fff;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
		border-radius: 8px;
		overflow: auto;
		flex: 1;
	}
</style>
